/*
 * @Autor: Mr Lu
 * @Version: 1.0
 * @Date: 2019-12-03
 * @LastEditors: OBKoro1
 * @LastEditTime: 2019-12-03
 * @Description:  实测实量首页
 */
<template>
  <div id="QualityManagementHome" class="p-box">
    <div class="p-return">
      <mu-appbar color="primary" class="lan-header">
        <mu-button icon slot="left" v-close>
          <i class="iconfont angle-left iconangle-left"></i>
          <span class="lan-header-back">返回</span>
        </mu-button>实测实量
      </mu-appbar>
    </div>
    <!-- <div class="p-header shadow">
      <WeatherModule></WeatherModule>
    </div>-->
    <div class="p-content">
      <div class="m-box" v-for="(menu) in menuList" :key="menu.id">
        <div class="m-title">{{menu.moduleName}}</div>
        <div class="m-content">
          <div class="menu-list">
            <div
              class="menu-item"
              v-for="(mod) in menu.moduleList"
              :key="mod.id"
              @click="skipPage(mod)"
              v-power="mod.power"
            >
              <img :src="mod.src" alt :class="mod.imgClass?mod.imgClass:''" />
              <span>{{mod.name}}</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import WeatherModule from "@/weather/WeatherModule";
export default {
  name: "QualityManagementHome",
  components: {
    WeatherModule
  },
  data() {
    return {
      menuList: [
        {
          id: "1",
          moduleName: "工作",
          moduleList: [
            {
              id: "1-1",
              name: "点位测量",
              src: require("#/assets/img/realMeasure/taskMode.png"),
              path: "TaskModeRealMeasure",
              power:"measureTask"
            },
            {
              id: "1-2",
              name: "随机测量",
              src: require("#/assets/img/realMeasure/randomMode.png"),
              path: "RandomSelectProject",
              power:"measureRandom"
            }
          ]
        },
        {
          id: "2",
          moduleName: "台账",
          moduleList: [
            {
              id: "2-1",
              name: "实测实量台账",
              src: require("#/assets/img/realMeasure/tLed.png"),
              path: "DutyAreaPlan",
              power:"measureParamter"
            },
            {
              id: "2-2",
              name: "随机测量台账",
              src: require("#/assets/img/realMeasure/rLed.png"),
              path: "RandomMeasureLedgerList",
              power:"measureRandomParamter"
            }
          ]
        }
      ]
    };
  },
  computed: {},
  created() {
    this.$nextTick(()=>{
      this.handemptyDOM('m-box','menu-item');
    })
  },
  mounted() {},
  watch: {},
  methods: {
    handemptyDOM(box,testDom){
      let el = document.getElementsByClassName(box)
      if(el.length){
        for(let i=0;i<el.length;i++){
          let str = el[i].innerHTML+'';
          if(str.indexOf(testDom) === -1){
            el[i].style.display = "none";
          }
        }
      }
    },
    skipPage(item) {
      this.$router.push({
        name: item.path
      });
    }
  },
  destroyed() {}
};
</script>

<style lang="scss">
#QualityManagementHome {
}
</style>
